package com.addzero.kmp.util.data_structure.coll

import com.addzero.kmp.entity.PageResult

/**
 * 分页接口，定义分页对象的基本属性
 */
interface Pageable<T> {
    var pageNum: Int
    var records: List<T>
    var total: Int
}

data class SpecPageResult<T>(
    val rows: List<T> = emptyList(),

    val total: Long = 0L,

    val pageNum: Int = 0,

)  {
    companion object {
      fun <T> empty(pageSize: Int = 20) =
          SpecPageResult<T>(
              rows = emptyList(),
              total = 0,
              pageNum = 0,
          )
    }
}
